home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 1219 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: newshost.lanl.gov!tanmoy
  2. From: tanmoy@qcd.lanl.gov (Tanmoy Bhattacharya)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: How to dynamically allocate first element of linked list.
  5. Date: 12 Jan 1996 05:35:24 GMT
  6. Organization: Los Alamos National Laboratory
  7. Message-ID: <TANMOY.96Jan11223524@qcd.lanl.gov>
  8. References: <erkDL007G.rt@netcom.com> <4d489q$7qg@dub-news-svc-5.compuserve.com>
  9. NNTP-Posting-Host: qcd.lanl.gov
  10. Mime-Version: 1.0
  11. Content-Type: text
  12. In-reply-to: 102642.2026@compuserve.com's message of 11 Jan 1996 23:59:54 GMT
  13.  
  14. --text follows this line--
  15. In article <4d489q$7qg@dub-news-svc-5.compuserve.com>
  16. 102642.2026@compuserve.com (Ja Uhm) writes: 
  17. <snip>
  18.    You must cast the return from malloc to the type (elmnt *) .
  19.  
  20.    Therefore use:
  21.  
  22.    newptr = (elmnt *) malloc(sizeof(struct elmnt));
  23.  
  24. must? In C? Why not read the FAQ before posting?
  25.  
  26. Cheers
  27. Tanmoy
  28. --
  29. tanmoy@qcd.lanl.gov(128.165.23.46) DECNET: BETA::"tanmoy@lanl.gov"(1.218=1242)
  30. Tanmoy Bhattacharya O:T-8(MS B285)LANL,NM87545 H:#9,3000,Trinity Drive,NM87544
  31. Others see <gopher://yaleinfo.yale.edu:7700/00/Internet-People/internet-mail>,
  32. <http://alpha.acast.nova.edu/cgi-bin/inmgq.pl>or<ftp://csd4.csd.uwm.edu/pub/
  33. internetwork-mail-guide>. -- <http://nqcd.lanl.gov/people/tanmoy/tanmoy.html>
  34. fax: 1 (505) 665 3003   voice: 1 (505) 665 4733    [ Home: 1 (505) 662 5596 ]
  35.